<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    class Foo {
      async *[Symbol.asyncIterator]() { }
    }
    let foo = new Foo();
    console.log(foo[Symbol.asyncIterator]())

    class Emitter {
      constructor(max) {
        this.max = max
        this.asyncIdx = 0
      }
      async *[Symbol.asyncIterator]() {
        while (this.asyncIdx < this.max) {
          yield new Promise(resolve => resolve(this.asyncIdx++))
        }
      }
    }
    async function asyncCount() {
      let emitter = new Emitter(5)
      for await (const x of emitter) {
        console.log(x)
      }
    }
    asyncCount()
    class Foo1 { }
    const foo1 = new Foo1()
    console.log(Foo[Symbol.hasInstance](foo1))
  </script>
</body>

</html>